"""
@file: app.py
@author：wang
@time: 2022/2/22 0022 20:29
"""
from flask_migrate import Migrate, MigrateCommand

from apps import create_app
from flask_script import Manager
from apps.models.news_models import *
from apps.models.user_models import *
from exts import db

app = create_app()

# 命令行启动项目
manage = Manager(app=app)

# 同步数据库命令
migrate = Migrate(app=app, db=db)
manage.add_command("db", MigrateCommand)
if __name__ == '__main__':
    manage.run()
